1. Field
The disclosure relates to an image sensor having an output of an integral image.
2. Description of Related Art
More and more image recognition techniques (for example, a face detection function of a digital camera) are now applied to small-scale embedded systems. Besides an image sensor, the embedded system also includes a high-speed embedded processor, which is used for processing images captured by the image sensor to recognize image features. Recently, Haar-like features are widely used in the image recognition domain, and especially used for the face detection. By using the Haar-like features and an adaptive boost (ADABOOST) algorithm, an image can be roughly and quickly classified into two groups, and by repeatedly executing such classifying procedure, the image can be quickly classified into a plurality of image clusters, so as to achieve the image recognition function.
The ADABOOST algorithm is a commonly used classifier fusion method, which can combine a plurality of weak classifier into a strong classifier. In detail, according to the ADABOOST algorithm, each data in a raw image set is weighted, and the weights are updated according to a classification result of an established sub classifier thereof, and then data required for establishing a next sub classifier is generated according to the weights. Since the new sub classifier is mainly used for reinforcing an inadequate part (classification error) of a previous classifier, the weight of the data of the previous classification error is increased. Conversely, the weight of the correctly classified data is reduced. Accordingly, the new sub classifier is re-established. Detail steps are as follows:
Assuming Dt(i) represents a data significance distribution after a t-th iteration, wherein i represents an i-th data, and assuming the significance of each data is the same at the beginning, so thatD1(i)=1/m  (1)
Wherein, m represents a number of data samples.
Assuming h represents a sub classification function and x represents a data point, ht(x) is then a result that the sub classifier classifies the data point x. Moreover, assuming y represents a correct classification result (+/−1, dichotomy), wherein if the classification is correct h(x) y, y*h(x)=+1, a significance of the data point can be reduced; and if the classification is incorrect h(x)≠y, y*h(x)=−1, the significance of the data point should be increased. Moreover, assuming a represents a weight required for modifying the data significance distribution and Z represents a normalization factor, the weight α after iteration can be calculated according to an error rate εt, and then the data significance distribution D(i) is modified according to the weight a and a determination of whether the classification is correct:
                              α          t                =                              1            2                    ⁢          ln          ⁢                                    1              -                              ɛ                t                                                    ɛ              t                                                          (        2        )                                                      D                          t              +              1                                ⁡                      (            i            )                          =                                                            D                t                            ⁡                              (                i                )                                      ⁢                          ⅇ                                                -                                      α                    t                                                  ⁢                                  y                  i                                ⁢                                                      h                    t                                    ⁡                                      (                                          x                      i                                        )                                                                                            Z            t                                              (        3        )            
Then, a new sub classification function ht+1 is trained according to Dt+1(i), and after T iterations, a final classification function is:
                              H          ⁡                      (            x            )                          =                  sign          (                                    ∑                              t                =                1                            T                        ⁢                                          α                t                            ⁢                                                h                  i                                ⁡                                  (                  x                  )                                                              )                                    (        4        )            
Finally, a classification of the test data is determined according to a vote number (i.e. the classification result H(x)).
FIGS. 1(a)-(d) are schematic diagrams of the conventional Haar-like features. Referring to FIGS. 1(a)-(d), the Haar-like features can be regarded as a group formed by a plurality of blocks, for example, two blocks (FIG. 1 (a)), three blocks (FIG. 1(b)), or four blocks (FIG. 1(c)), and a feature value thereof is a sum of pixel values of pixels covered by the blocks in the image, wherein the white block represents +1 and the black block represents −1. For example, in the three-block group, the feature value is a sum of the pixel values of the pixels covered by a middle white block in the image 100 minus a sum of the pixel values of the pixels covered by a left and a right black block in the image 100 (shown as FIG. 1(d)), and the feature value is generally calculated according to an integral image.
For example, FIG. 2(a) and FIG. 2(b) are schematic diagrams illustrating conventional methods of calculating the feature value. Referring to FIG. 2(a) first, an integral value of a pixel P(x2,y2) in an image 200 is a sum of pixel values of pixels within a rectangular block spanned by the pixel O(x1,y1) of the top-left corner to the pixel P(x2,y2). Next, referring to FIG. 2(b), a feature value of a block ABCD is A−B−C+D, wherein A is a feature value of a rectangular block spanned by the pixel O to the pixel A, B is a feature value of a rectangular block spanned by the pixel O to the pixel B, C is a feature value of a rectangular block spanned by the pixel O to the pixel C, and D is a feature value of a rectangular block spanned by the pixel O to the pixel D.
As described above, a high-speed processor has to be applied to calculate the integral image when recognizing the image feature. Then, the integral image is used to calculate the feature value, and perform the image recognition and the face detection, etc. Such complicated operation process can greatly consume an operation performance of the processor, so that it can be a great burden for an embedded processor of the digital camera, which is required to simultaneously process multiple functions.